function [ ] = main()
%UNTITLED2 Summary of this function goes here
%   Detailed explanation goes here
    x = -5:1:5;
    Y = R(x);
    xi = -5 : 0.01:5;
    y = R(xi);

    yi = Interp( x, Y, xi, 'linear');
    
    plot(xi,y,xi,yi)
    hold on
    plot(x,Y,'.','MarkerSize',10)
    hold off
    title('linear');
    pause on
    h = gcf;
    hgexport(h,'linear');
    fprintf('按任意键继续！')
    %pause()
    
    yi = Interp( x, Y, xi, 'newton');
    plot(xi,y,xi,yi);
    title('Newton')    
    hold on
    plot(x,Y,'.','MarkerSize',10)
    hold off
    h = gcf;
    hgexport(h,'newton');
    
    Y1 = R1(x);
    yi = Interp( x, Y, xi, 'hermite',Y1);
    plot(xi,y,xi,yi);
    title('Hermite')   
    hold on
    plot(x,Y,'.','MarkerSize',10)
    hold off
    h = gcf;
    hgexport(h,'hermite');
    
    Y1 = R1(x);
    yi = Interp( x, Y, xi, 'spline');    
    plot(xi,y,xi,yi);
    title('Spline')   
    hold on
    plot(x,Y,'.','MarkerSize',10)
    hold off
    h = gcf;
    hgexport(h,'spline');
    fprintf('按任意键继续！')
    %pause()
    x = 5*cos(pi/42:pi/21:41*pi/42);
    Y = R(x);
    yi = Interp( x, Y, xi, 'lagrange');
    plot(xi,y,xi,yi);
    title('Lagrange')   
    hold on
    plot(x,Y,'.','MarkerSize',10)
    hold off
    h = gcf;
    hgexport(h,'lagrange');
end

